import Layout from '@/views/admin/common/layout'
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/',
    redirect: '/admin'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login'),
    meta: { title: '登录', keepAlive: false, index: 0, anonymous: true }
  }
]

/**
 * 自定义路由
 * @type { *[] }
 */
export const customRouterMap = [
  {
    path: '/shop', // 商店
    name: 'shop',
    component: Layout,
    redirect: '/shop/list',
    children: [
     {
        path: '/shop/list',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shop'),
        meta: { title: '商品管理', keepAlive: false}
      }, {
        path: '/shop/category',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/category'),
        meta: { title: '商品分类', keepAlive: false }
      }, {
        path: '/order/list',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/order/list'),
        meta: { title: '交易中的订单', keepAlive: false }
      }, {
        path: '/order/finish',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/order/finish'),
        meta: { title: '已完结的订单', keepAlive: false }
      }, {
        path: '/shop/settings',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/settings'),
        meta: { title: '业务配置', keepAlive: false }
      }, {
        path: '/shopInfo',
        component: () => import(/* webpackChunkName: "shop" */ '@/views/shopInfo'),
        meta: { title: '动态管理', keepAlive: false }
      }
     ]
  },
  {
    path: '/admin', // 后台
    name: 'admin',
    component: Layout,
    // redirect: () => '/admin/index',
    redirect: '/shop/list',
    children: [
      {
        path: '/admin/index',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/main'),
        meta: { title: '首页', keepAlive: false}
      },
      {
        path: '/article',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/article'),
        meta: { title: '通知公告', keepAlive: false}
      },
      {
        path: '/admin/org',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/org'),
        meta: { title: '机构管理', keepAlive: false}
      },
      {
        path: '/admin/app',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/app'),
        meta: { title: '应用管理', keepAlive: false}
      },
      {
        path: '/admin/user',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/user'),
        meta: { title: '用户管理', keepAlive: false}
      },
      {
        path: '/admin/role',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/role'),
        meta: { title: '角色管理', keepAlive: false}
      },
      {
        path: '/admin/logs',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/logs'),
        meta: { title: '日志查看', keepAlive: false }
      },
      {
        path: '/audit/logs',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/logs/audit'),
        meta: { title: '审计日志', keepAlive: false }
      },
       {
        path: '/admin/settings',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/admin/manager/settings'),
        meta: { title: '系统设置', keepAlive: false}
      },
      {
        path: '/dbtable',
        component: () => import(/* webpackChunkName: "admin" */ '@/views/dbtable'),
        meta: { title: '数据表管理', keepAlive: false }
      }
     ]
  },
  {
    path: '/magic',
    component: () => import(/* webpackChunkName: "admin" */ '@/views/magic'),
    meta: { title: '接口管理', keepAlive: false,  anonymous: true }
  },
  {
    path: '*',
    component: () => import('@/views/admin/common/404'),
    meta: { title: '找不到页面', keepAlive: false, anonymous: true}
  }
]

